'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview 签到日列表
 * @author sundbcn@gmail.com (sun debing)
 */

var mongoose = require('mongoose');
var _ = require('lodash');
var dataApi = require('../../libs/dataApi');

///////////////////////////////////////////////////////////
/**
 * 签到状态信息
 * @type {mongoose}
 */
var checkDaySchema = new mongoose.Schema({
    // 签到日期
    check_day: {
        type: Number,
        required: true
    },

    // 签到状态 1表示签到 2补签
    status: {
        type: Number,
        default: 0
    }
});

/**
 * 获取签到日
 * @return {[type]} [description]
 */
checkDaySchema.methods.getCheckDay = function () {
    return this.check_day;
};

/**
 * 获取签到状态
 * @return {[type]} [description]
 */
checkDaySchema.methods.getStatue = function () {
    return this.status;
};

if (!checkDaySchema.options.toJSON) {
    checkDaySchema.options.toJSON = {};
}
/* jshint unused:false */
checkDaySchema.options.toJSON.transform = function (doc, ret) {
    delete ret._id;
    delete ret.__v;
};

module.exports = checkDaySchema;
